{if condition="strpos(get_url(), 'add') neq  ''"}
<!--发布页面-->
<textarea class="layui-textarea" name="content" id="content" required="" lay-verify="content" style="display: none"></textarea>
{/if} 

{if condition="strpos(get_url(), 'edit') neq  ''"}
<!--编辑页面-->
<textarea class="layui-textarea" name="content" id="content" required="" lay-verify="content" style="display: none">{$c['content']}</textarea>
{/if} 



<script src="*ADMIN*/layui/ace/ace.js"></script>
<script >
var editor;
var layedit;
layui.use(['layedit', 'form', 'upload'],
function() {
    var form = layui.form,
    upload = layui.upload,
    jq = layui.jquery,
    layedit = layui.layedit;
    layedit.set({
        uploadImage: {
            url: '{:url('upimg/up')}',
            accept: 'image',
            acceptMime: 'image/*',
            exts: 'jpg|png|gif|bmp|jpeg',
            size: '10240'
        },
        uploadVideo: {
            url: '{:url('upimg/up')}',
            accept: 'video',
            acceptMime: 'video/*',
            exts: 'mp4|flv|avi|rm|rmvb',
            size: '20480'
        }
        
        //右键删除图片/视频时的回调参数，post到后台删除服务器文件等操作，
        //传递参数：
        //图片： imgpath --图片路径
        //视频： filepath --视频路径 imgpath --封面路径
        ,
        calldel: {
            url: '{:url('upimg/up')}'
        }
        //开发者模式 --默认为false
        ,
        devmode: false
        //插入代码设置
        ,
        codeConfig: {
            hide: true,
            //是否显示编码语言选择框
        default:
            'javascript' //hide为true时的默认语言格式
        },
         tool: [
                    'html', 'undo', 'redo', 'code', 'strong', 'italic', 'underline', 'del', 'addhr', '|', 'removeformat', 'fontFomatt', 'fontfamily', 'fontSize', 'fontBackColor', 'colorpicker', 'face'
                    , '|', 'left', 'center', 'right', '|', 'link', 'unlink', 'images', 'image_alt', 'video',  'anchors'
                    , '|'
                    , 'table', 'customlink'
                    , 'fullScreen', 'preview'
                ],
        height: '300'
    });
    editor = layedit.build('content');
    form.verify({
        content: function(value) {
            return layedit.sync(editor);
        },
    });
})
var tag = new Tag("tagValue");
tag.initView();
</script>